package com.dmp.customer.controller;


import com.dmp.common.entity.Result;
import com.dmp.customer.entity.Customer;
import com.dmp.customer.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: Xiaohei
 * @CreateTime: 2021/12/27 21:43
 */
@RestController
@RequestMapping("/customer")
public class CustomerController {

    @Autowired
    private CustomerService customerService;

    @PostMapping("/add")
    public Result addCustomer(@RequestBody Customer customer) {
        boolean add = customerService.addCustomer(customer);
        return Result.success(add);
    }

    @PostMapping("/update")
    public Result updateCustomer(@RequestBody Customer customer) {
        return null;
    }

    @PostMapping("/delete")
    public Result deleteCustomer(String uuid) {
        return null;
    }

    @GetMapping("/page")
    public Result queryPage(@RequestParam(value = "name", required = false) String name,
                            @RequestParam(value = "phone", required = false) String phone,
                            @RequestParam(value = "company", required = false) String company) {
        return new Result();
    }
}
